
  <div class="x_panel">
    <div class="x_content" style="display: block;">
      <!--表格主体内容-->
      <div class="nav navbar-left panel_toolbox">
        <select class="form-control-area" name="form[province_id]" id="zone1">
          <option value="0">请选择</option>
          {foreach $province AS $key => $value}
          <option value="{$value.region_code}">{$value.region_name}</option>
          {/foreach}
        </select>

        <select class="form-control-area" name="form[city_id]" id="zone2">
          <option value="0">请选择</option>
        </select>

        <select class="form-control-area" name="form[district_id]" id="zone3">
          <option value="0">请选择</option>
        </select>

        <select class="form-control-area" name="form[street_id]" id="zone4">
          <option value="0">请选择</option>
        </select>
      </div>
      <br><br>
      <div class="cont">

        入场券收入:<span id="quan">0</span>元<br/>
        商品出售收入:<span id="sale_goods">0</span>元<br/>
        商品收回支出:<span id="recovery_goods">0</span>元<br/>
        会员卡充值:<span id="card">0</span>元

      </div>
    </div>
  </div>
  <script>
      $('#zone1').change(function (e) {
          var zoneid = this.value;
          var url = "{['area/getzone']|U}";
          var income = "{['order/income']|U}"
          $.post(url, 'zoneid='+zoneid, function (data) {
              $('#zone2').html('');
              $('#zone2').append("<option value='0'>请选择</option>");
              for(var i=0; i<data.length; i++){
                  $('#zone2').append("<option value= '"+data[i].region_code+"'>"+data[i].region_name+"</option>");
              }
              $.post(url, 'zoneid='+data[0].region_code, function (data1) {
                  $('#zone3').html('');
                  $('#zone3').append("<option value='0'>请选择</option>");
                  for(var i=0; i<data1.length; i++){
                      $('#zone3').append("<option value= '"+data1[i].region_code+"'>"+data1[i].region_name+"</option>");
                  }
                  $.post(url, 'zoneid='+data1[0].region_code, function (data2) {
                      $('#zone4').html('');
                      $('#zone4').append("<option value='0'>请选择</option>");
                      for(var i=0; i<data2.length; i++){
                          $('#zone4').append("<option value= '"+data2[i].region_code+"'>"+data2[i].region_name+"</option>");
                      }
                  },'json');
              },'json');

          },'json');
          $.post(income, 'zoneid='+zoneid+'&type=0', function (result) {
              $('#quan').text(result.quan);
              /*$('#sale_goods').text(result.sale_goods);
              $('#recovery_goods').text(result.recovery_goods);
              $('#card').text(result.card);*/
          },'json');
      })
      $('#zone2').change(function (e) {
          var zoneid = this.value;
          var url = "{['area/getzone']|U}";
          $.post(url, 'zoneid='+zoneid, function (data) {
              $('#zone3').html('');
              $('#zone3').append("<option value='0'>请选择</option>");
              for(var i=0; i<data.length; i++){
                  $('#zone3').append("<option value= '"+data[i].region_code+"'>"+data[i].region_name+"</option>");
              }
              $.post(url, 'zoneid='+data[0].region_code, function (data1) {
                  $('#zone4').html('');
                  $('#zone4').append("<option value='0'>请选择</option>");
                  for(var i=0; i<data1.length; i++){
                      $('#zone4').append("<option value= '"+data1[i].region_code+"'>"+data1[i].region_name+"</option>");
                  }
              },'json');
          },'json');
      })
      $('#zone3').change(function (e) {
          var zoneid = this.value;
          var url = "{['area/getzone']|U}";
          $.post(url, 'zoneid='+zoneid, function (data) {
              $('#zone4').html('');
              $('#zone4').append("<option value='0'>请选择</option>");
              for(var i=0; i<data.length; i++){
                  $('#zone4').append("<option value= '"+data[i].region_code+"'>"+data[i].region_name+"</option>");
              }
          },'json');
      })
      /*$('#zone4').change(function (e) {
          var zoneid = this.value;
          var url = "{['area/getzone1']|U}";
          $.post(url, 'zoneid='+zoneid, function (data) {
          },'json');
      })*/
  </script>

